package com.wfuhui.modules.store.api;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wfuhui.common.utils.R;
import com.wfuhui.modules.store.entity.UserCouponEntity;
import com.wfuhui.modules.store.service.UserCouponService;

@RestController
@RequestMapping("/api/coupon")
public class ApiCouponController {
	
	@Autowired
	private UserCouponService userCouponService;
	
    
    @GetMapping("get")
    public R coupon(@RequestAttribute("userId") Long userId, Integer status) {
    	Map<String, Object> map = new HashMap<String, Object>();
    	map.put("userId", userId);
    	map.put("status", status);
    	List<UserCouponEntity> userCouponList = userCouponService.queryList(map);
    	return R.ok().put("userCouponList", userCouponList);
    }
}
